<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>不同虚拟机的配置方式 | Element</title><meta name="keywords" content="IaaS"><meta name="author" content="FHang"><meta name="copyright" content="FHang"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="不同虚拟机的配置方式虚拟机软件的选择：VirtualBox6.0及以上；VmwareWorkstation VirtualBox的配置方法：1. controller的安装过程：1.我们准备好centos7和iaas2.2的iso文件  2.在一个磁盘空间充足的磁盘下新建两个文件夹VT-controller; VT-compute, 之后的两个节点分别安装在这两个文件夹下  3.打开Virtual">
<meta property="og:type" content="article">
<meta property="og:title" content="不同虚拟机的配置方式">
<meta property="og:url" content="https://fhangh.gitee.io/article/229dff60.html">
<meta property="og:site_name" content="Element">
<meta property="og:description" content="不同虚拟机的配置方式虚拟机软件的选择：VirtualBox6.0及以上；VmwareWorkstation VirtualBox的配置方法：1. controller的安装过程：1.我们准备好centos7和iaas2.2的iso文件  2.在一个磁盘空间充足的磁盘下新建两个文件夹VT-controller; VT-compute, 之后的两个节点分别安装在这两个文件夹下  3.打开Virtual">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_06.jpg">
<meta property="article:published_time" content="2020-11-05T08:48:05.574Z">
<meta property="article:modified_time" content="2021-03-14T05:50:06.299Z">
<meta property="article:author" content="FHang">
<meta property="article:tag" content="IaaS">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_06.jpg"><link rel="shortcut icon" href="/fhangh/img/fh.png"><link rel="canonical" href="https://fhangh.gitee.io/article/229dff60"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="yandex-verification" content="{&quot;theme_color&quot;:{&quot;enable&quot;:true,&quot;main&quot;:&quot;#49B1F5&quot;,&quot;paginator&quot;:&quot;#00c4b6&quot;,&quot;button_hover&quot;:&quot;#FF7242&quot;,&quot;text_selection&quot;:&quot;#00c4b6&quot;,&quot;link_color&quot;:&quot;#99a9bf&quot;,&quot;meta_color&quot;:&quot;#858585&quot;,&quot;hr_color&quot;:&quot;#A4D8FA&quot;,&quot;code_foreground&quot;:&quot;#F47466&quot;,&quot;code_background&quot;:&quot;rgba(27, 31, 35, .05)&quot;,&quot;toc_color&quot;:&quot;#00c4b6&quot;,&quot;blockquote_padding_color&quot;:&quot;#49b1f5&quot;,&quot;blockquote_background_color&quot;:&quot;#49b1f5&quot;}}"/><link rel="stylesheet" href="/fhangh/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/fhangh/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  ClickShowText: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"top-right"},
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-03-14 13:50:06'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><meta name="generator" content="Hexo 5.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="/fhangh/img/fh.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/fhangh/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/fhangh/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/fhangh/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li><li><a class="site-page" href="/fhangh/Gallery/"><i class="fa-fw fas fa-images"></i><span> Image</span></a></li></ul></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img/postImg_06.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/fhangh/">Element</a></span><span id="menus"><div id="search_button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/fhangh/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/fhangh/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/fhangh/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li><li><a class="site-page" href="/fhangh/Gallery/"><i class="fa-fw fas fa-images"></i><span> Image</span></a></li></ul></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">不同虚拟机的配置方式</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-11-05T08:48:05.574Z" title="发表于 2020-11-05 16:48:05">2020-11-05</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-03-14T05:50:06.299Z" title="更新于 2021-03-14 13:50:06">2021-03-14</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/fhangh/categories/%E4%BA%91%E8%AE%A1%E7%AE%97/">云计算</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>7分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="不同虚拟机的配置方式"><a href="#不同虚拟机的配置方式" class="headerlink" title="不同虚拟机的配置方式"></a>不同虚拟机的配置方式</h1><p>虚拟机软件的选择：VirtualBox6.0及以上；VmwareWorkstation</p>
<h4 id="VirtualBox的配置方法："><a href="#VirtualBox的配置方法：" class="headerlink" title="VirtualBox的配置方法："></a>VirtualBox的配置方法：</h4><h5 id="1-controller的安装过程："><a href="#1-controller的安装过程：" class="headerlink" title="1. controller的安装过程："></a>1. controller的安装过程：</h5><p>1.我们准备好centos7和iaas2.2的iso文件 </p>
<p>2.在一个磁盘空间充足的磁盘下新建两个文件夹VT-controller; VT-compute, 之后的两个节点分别安装在这两个文件夹下 </p>
<p>3.打开VirtualBox–新建–名称：Controller</p>
<p>文件夹：选择之前新建的VT-controller文件夹所在地址</p>
<p>类型：Linux</p>
<p>版本：Other Linux（64bit）</p>
<p>内存：4096MB</p>
<p>虚拟硬盘：现在创建虚拟硬盘</p>
<p>4.文件位置：默认</p>
<p>5.文件大小：40GB</p>
<p>6.虚拟硬盘类型：VDI</p>
<p>7.存储在物理硬盘上：动态分配</p>
<p>此时controller的模板创建好了</p>
<p>1.管理–主机网络管理器–创建（创建两个虚拟网卡）</p>
<p>第一块网卡（手动配置）– IPV4：192.168.100.1（内网）</p>
<p> 子网掩码：255.255.255.0</p>
<p>DHCP服务器关了</p>
<p>第二块网卡（手动配置）– IPV4：192.168.200.1（外网）</p>
<p>  子网掩码：255.255.255.0</p>
<p>同样关掉DHCP服务</p>
<p>2.主页面中–设置–系统（主板）–启动顺序：勾上网络，选中光驱，点边上的”向上“箭头移动到最上方</p>
<p>（处理器）–处理器数量：4</p>
<p>网络（网卡1）–启用网络连接–界面名称：第一网卡</p>
<p>  方式：仅主机–高级–混杂：全部允许</p>
<p> （网卡2）–界面名称为第二款网卡，其它配置同网卡1相同–OK</p>
<p>3.在主页面中，存储–第二IDE控制器主通道（点击选择centos7.ios）</p>
<p>4.启动（controller节点已经配置好了）</p>
<h5 id="2-controller节点的安装过程"><a href="#2-controller节点的安装过程" class="headerlink" title="2. controller节点的安装过程"></a>2. controller节点的安装过程</h5><p>在centos安装之前，可以在安装界面按“Tab”键</p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/1.png">



<p>在原有的内容后面–空格–输入：net.ifnames=0 biosdevname=0</p>
<p>可以禁用网卡命名规则，是的两块网卡（内网和外网）分别为eth0和eth1，方便后面使用，不过后面的内容里，要自觉将ifcfg-enp0s3和ifcfg-enp0s8换成ifcfg-eth0和ifcfg-eth1，即可</p>
<p>1.Install Centos7</p>
<p>2.Continue（默认英文，千万别选中文，搭建过程中会乱码和报错，之后也不会安装图形化界面，因为没必要）–SYSTEM选项中的（installtion  destination）–other storage options选项中：选中I will configure partioning</p>
<p>3.Done–Click here to create them automatically（若有/home目录，选中点击下面的‘—’号，可以删除，因为不需要）</p>
<p>4.Done–Accept Changes</p>
<p>5.Begin Installation</p>
<p>6.此时在安装过程中可以设置Root用户的密码，密码：000000，因为方便；其它的不管</p>
<p>7.reboot完成controller的安装</p>
<h5 id="3-compute的安装过程："><a href="#3-compute的安装过程：" class="headerlink" title="3. compute的安装过程："></a>3. compute的安装过程：</h5><p>1.新建–名称：Compute</p>
<p>文件夹：选择之前新建的VT-controller文件夹所在地址</p>
<p>类型：Linux</p>
<p>版本：Other Linux（64bit）</p>
<p>内存：2048MB</p>
<p>虚拟硬盘：现在创建虚拟硬盘</p>
<p>4.文件位置：默认</p>
<p>5.文件大小：40GB</p>
<p>6.虚拟硬盘类型：VDI</p>
<p>7.存储在物理硬盘上：动态分配</p>
<p>此时compute的模板创建好了</p>
<p>1.主页面中–设置–系统（主板）–启动顺序：勾上网络，选中光驱，点边上的”向上“箭头移动到最上方</p>
<p>（处理器）–处理器数量：2</p>
<p>网络（网卡1）–启用网络连接–界面名称：第一网卡</p>
<p>  方式：仅主机–高级–混杂：全部允许</p>
<p> （网卡2）–界面名称为第二款网卡，其它配置同网卡1相同–OK</p>
<p>2.在主页面中，存储–第二IDE控制器主通道（点击选择centos7.ios）</p>
<p>3.启动（compute节点已经配置好了）</p>
<h5 id="4-controller节点的安装过程"><a href="#4-controller节点的安装过程" class="headerlink" title="4. controller节点的安装过程"></a>4. controller节点的安装过程</h5><p>就照着上面controller节点的安装过程一样的步骤来</p>
<p>至此两个节点都安装完毕！！！</p>
<p>接着要对compute节点再照护一下，先将compute节点关机再操作</p>
<p>compute节点的磁盘分区（parted和fdisk两种方法，推荐用parted）</p>
<p>1.在主页面中–（选中）compute节点–设置–存储–（存储介质：控制器IDE）最右边有个鼠标移上去会显示“添加虚拟硬盘”并点击–创建新的虚拟盘–文件大小：20GB–虚拟硬盘文件类型VDI–创建–OK</p>
<p>2.开启compute节点（要对新添加的虚拟硬盘进行配置）</p>
<h5 id="5-在compute中：（parted）"><a href="#5-在compute中：（parted）" class="headerlink" title="5. 在compute中：（parted）"></a>5. 在compute中：（parted）</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">\# fdisk -l</span><br><span class="line"></span><br><span class="line">可以看到Disk &#x2F;dev&#x2F;sdb</span><br><span class="line"></span><br><span class="line">\# parted &#x2F;dev&#x2F;sdb </span><br><span class="line"></span><br><span class="line">\#p</span><br><span class="line"></span><br><span class="line">\#h</span><br></pre></td></tr></table></figure>
<p>4.可以看到如图的内容： </p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/2.png">



<h5 id="6-我们需要分别进行mklabel和mkpart"><a href="#6-我们需要分别进行mklabel和mkpart" class="headerlink" title="6. 我们需要分别进行mklabel和mkpart"></a>6. 我们需要分别进行mklabel和mkpart</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">\#mklable gpt</span><br><span class="line"></span><br><span class="line">\#mkpart cinder</span><br><span class="line"></span><br><span class="line">\#xfs</span><br><span class="line"></span><br><span class="line">\#0</span><br><span class="line"></span><br><span class="line">\#8G</span><br><span class="line"></span><br><span class="line">\#I</span><br><span class="line"></span><br><span class="line">\#p</span><br></pre></td></tr></table></figure>


<p>6.此时可以看到已经分好了一个8G的分区cinder</p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/3.png"> 

<p>7.同理</p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/4.png">

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">\#q（退出）</span><br></pre></td></tr></table></figure>
<p>此时swift的盘也分好了</p>
<p>cinder和swift的盘分别对应这sdb1和sdb2，后面的IaaS搭建里的openrc配置里会用上</p>
<h5 id="7-fdisk的分区方法："><a href="#7-fdisk的分区方法：" class="headerlink" title="7. fdisk的分区方法："></a>7. fdisk的分区方法：</h5><p>sdb1的创建方式：  </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">\#fdisk &#x2F;dev&#x2F;sdb </span><br><span class="line"></span><br><span class="line">\#m</span><br></pre></td></tr></table></figure>


<p>可以看到帮助文档</p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/5.png">

<p>其中n为添加一个新的分区，w为分好后保存，退出（如果没有w，直接退出，就等于没分区）</p>
<p><img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/6.png">前几个都是默认即可，回车</p>
<p>一直到 Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +8G</p>
<p>+size{K,M,G} 其中，+size是你要划分的大小数值，{K,M,G}里的三个为可选的单位，我们这里仅为演示所以我是+8G</p>
<p>#w （保存，退出）</p>
<p>此时一个分区创建好了（sdb1）</p>
<p>sdb2的创建方式如下：</p>
<img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/7.png">

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">\#fdisk -l</span><br></pre></td></tr></table></figure>


<p>可以看到两个都创建好了 </p>
<p><img src= "/fhangh/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/1.%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F/8.png">这里关于compute节点的磁盘分区就到这了！</p>
<p>接着在compute节点中：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">\#parted &#x2F;dev&#x2F;sd*</span><br><span class="line"></span><br><span class="line">（可以看到其中有sda, sda1, sda2, sdb, sdb1, sdc, sdc1；其中sdb1,sdb2分别为后面要配置的cinder和swift两个云盘）</span><br></pre></td></tr></table></figure>


<p>以上就是VirtualBox的配置方法</p>
<p>接下来就是VmwareWorkstation的配置方式</p>
<p>首先在主页面的上菜单栏中–编辑–虚拟网络编辑器–(VmwareWorkstation自己默认有一个VMnet0)–添加网络（添加两个，分别为VM net1，VMnet2）–选中VMnet1–在VMnet信息中选中‘仅主机模式’–选中‘将主机虚拟适配器连接到此网络’，取消使用本地DHCP–子网IP：192.168.100.0–子网掩码：255.255.255.0（内网）</p>
<p>选中VMnet2–在VMnet信息中选中‘NAT模式’–选中‘将主机虚拟适配器连接到此网络’，取消使用本地DHCP–子网IP：192.168.200.0–子网掩码：255.255.255.0（外网）</p>
<p>网卡配置好了，接下来是两个控制节点</p>
<h4 id="8-controller的安装过程："><a href="#8-controller的安装过程：" class="headerlink" title="8. controller的安装过程："></a>8. controller的安装过程：</h4><p>1.我们准备好centos7和iaas2.2的iso文件 </p>
<p>2.在一个磁盘空间充足的磁盘下新建两个文件夹VM-controller; VM-compute, 之后的两个节点分别安装在这两个文件夹下</p>
<p>3.在主页面中–创建新的虚拟机–典型–下一步–稍后安装操作系统–下一步：客户机操作系统：Linux–下一步</p>
<p> 版本：centos7 64位</p>
<p>4.虚拟机名称：Controller</p>
<p> 位置：你所创建的VM-controller文件夹的地址–下一步</p>
<p> 最大磁盘大小：40GB</p>
<p> 选中：将虚拟磁盘拆分成多个文件–下一步–自定义硬件：内存：4GB</p>
<p>  处理器数量和内核都选：2；虚拟化引擎：选中‘虚拟化 InterVT-x/EPT或AMD-V/RVI ’</p>
<p>  选中‘新CD/DVD（IDE）’：添加一个新的‘新CD/DVD（IDE）’</p>
<p>  （两个IDE的设备状态选中启动时连接，连接选中使用ISO映像文件）</p>
<p>  浏览：centos7.iso文件的地址，第二个IDE选中iaas2.2.iso文件地址</p>
<p>   选中‘网络适配器’：添加一个新的‘网络适配器2’</p>
<p>（两个网络适配器，第一个：仅主机模式；第二个：默认NAT模式）–关闭–完成</p>
<p>5.鼠标移到创建好的controller节点上–右击–管理–克隆–下一步–下一步–创建方法：链接克隆–下一步–虚拟机名称：Compute</p>
<p>位置–浏览：VM-compute文件夹位置</p>
<p>–完成–关闭</p>
<p>6.编辑虚拟机–内存：2</p>
<p>处理器数量和内核都选：1；虚拟化引擎：选中‘虚拟化 InterVT-x/EPT或AMD-V/RVI ’</p>
<p>（其它不用动）</p>
<p>两个节点的配置完成，安装过程和VirtualBox的安装过程一样</p>
<p>接下来就是VmwareWorkstation中compute节点的添加磁盘了</p>
<p>选中compute节点–编辑虚拟机设置–硬盘–添加（硬盘，添加两个）–下一步–默认推荐–创建新虚拟硬盘–磁盘大小：20GB–将虚拟硬盘拆分成多个文件–下一步–完成</p>
<p>（第二块硬盘的文件名不可与第一块硬盘文件名相同，随别改一个）</p>
<p>现在启动compute节点，接下来的步骤和VirtualBox的磁盘配置方法相同</p>
<p>至此，两个不同虚拟机软件对两个不同节点的配置和磁盘划分的方法介绍完毕！！！</p>
<p>请看下一篇secureCRTP连接虚拟机！！！</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">FHang</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://fhangh.gitee.io/article/229dff60.html">https://fhangh.gitee.io/article/229dff60.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://fhangh.gitee.io" target="_blank">Element</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/fhangh/tags/IaaS/">IaaS</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_06.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/fhangh/article/40c15609.html"><img class="prev-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_08.jpg" onerror="onerror=null;src='/fhangh/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">secureCRT连接虚拟机</div></div></a></div><div class="next-post pull-right"><a href="/fhangh/article/2eec1551.html"><img class="next-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_02.jpg" onerror="onerror=null;src='/fhangh/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">HTML</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/fhangh/article/264a9a95.html" title="Iaas搭建"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_07.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-05</div><div class="title">Iaas搭建</div></div></a></div><div><a href="/fhangh/article/373ebcdf.html" title="secureCRT上传镜像"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_09.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-05</div><div class="title">secureCRT上传镜像</div></div></a></div><div><a href="/fhangh/article/40c15609.html" title="secureCRT连接虚拟机"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_08.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-05</div><div class="title">secureCRT连接虚拟机</div></div></a></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="/fhangh/img/fh.png" onerror="this.onerror=null;this.src='/fhangh/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">FHang</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/fhangh/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div><div class="card-info-data-item is-center"><a href="/fhangh/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div><div class="card-info-data-item is-center"><a href="/fhangh/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/FHangH"><i class="fab fa-github"></i><span>Link To</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/FHangH" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:752972182@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">个人学习笔记</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%8D%E5%90%8C%E8%99%9A%E6%8B%9F%E6%9C%BA%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F"><span class="toc-number">1.</span> <span class="toc-text">不同虚拟机的配置方式</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#VirtualBox%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="toc-number">1.0.0.1.</span> <span class="toc-text">VirtualBox的配置方法：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#1-controller%E7%9A%84%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%EF%BC%9A"><span class="toc-number">1.0.0.1.1.</span> <span class="toc-text">1. controller的安装过程：</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-controller%E8%8A%82%E7%82%B9%E7%9A%84%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B"><span class="toc-number">1.0.0.1.2.</span> <span class="toc-text">2. controller节点的安装过程</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#3-compute%E7%9A%84%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%EF%BC%9A"><span class="toc-number">1.0.0.1.3.</span> <span class="toc-text">3. compute的安装过程：</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#4-controller%E8%8A%82%E7%82%B9%E7%9A%84%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B"><span class="toc-number">1.0.0.1.4.</span> <span class="toc-text">4. controller节点的安装过程</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#5-%E5%9C%A8compute%E4%B8%AD%EF%BC%9A%EF%BC%88parted%EF%BC%89"><span class="toc-number">1.0.0.1.5.</span> <span class="toc-text">5. 在compute中：（parted）</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#6-%E6%88%91%E4%BB%AC%E9%9C%80%E8%A6%81%E5%88%86%E5%88%AB%E8%BF%9B%E8%A1%8Cmklabel%E5%92%8Cmkpart"><span class="toc-number">1.0.0.1.6.</span> <span class="toc-text">6. 我们需要分别进行mklabel和mkpart</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#7-fdisk%E7%9A%84%E5%88%86%E5%8C%BA%E6%96%B9%E6%B3%95%EF%BC%9A"><span class="toc-number">1.0.0.1.7.</span> <span class="toc-text">7. fdisk的分区方法：</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#8-controller%E7%9A%84%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%EF%BC%9A"><span class="toc-number">1.0.0.2.</span> <span class="toc-text">8. controller的安装过程：</span></a></li></ol></li></ol></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/3fadb38f.html" title="UE4联网和多人游戏"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_27.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4联网和多人游戏"/></a><div class="content"><a class="title" href="/fhangh/article/3fadb38f.html" title="UE4联网和多人游戏">UE4联网和多人游戏</a><time datetime="2022-05-26T14:04:45.432Z" title="发表于 2022-05-26 22:04:45">2022-05-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/7dd18469.html" title="UE4 RPC"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_26.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 RPC"/></a><div class="content"><a class="title" href="/fhangh/article/7dd18469.html" title="UE4 RPC">UE4 RPC</a><time datetime="2022-05-19T04:30:00.826Z" title="发表于 2022-05-19 12:30:00">2022-05-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/cb9854b2.html" title="UE4 MySQL插件使用"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_25.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 MySQL插件使用"/></a><div class="content"><a class="title" href="/fhangh/article/cb9854b2.html" title="UE4 MySQL插件使用">UE4 MySQL插件使用</a><time datetime="2022-03-27T06:49:30.840Z" title="发表于 2022-03-27 14:49:30">2022-03-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/605bd1ac.html" title="UE4 MySQL插件开发"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_24.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 MySQL插件开发"/></a><div class="content"><a class="title" href="/fhangh/article/605bd1ac.html" title="UE4 MySQL插件开发">UE4 MySQL插件开发</a><time datetime="2022-03-26T07:56:25.807Z" title="发表于 2022-03-26 15:56:25">2022-03-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/f7ede91d.html" title="Java基础"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_19.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="Java基础"/></a><div class="content"><a class="title" href="/fhangh/article/f7ede91d.html" title="Java基础">Java基础</a><time datetime="2021-12-12T07:47:44.788Z" title="发表于 2021-12-12 15:47:44">2021-12-12</time></div></div></div></div></div></div></div></main><footer id="footer" style="background-image: url(https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img/postImg_06.jpg)"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By FHang</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/fhangh/js/utils.js"></script><script src="/fhangh/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/fhangh/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})</script><div class="js-pjax"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="true"></script></div></body></html>